const Timestamp = new Date().getTime();
module.exports = {
  publicPath: process.env.NODE_ENV === "production" ? "./" : "/",
  outputDir: "dist",
  assetsDir: "assets",
  css: {
    loaderOptions: {
      less: {
        modifyVars: {
          red: "#c11823",
          "nav-bar-icon-color": "#333",
          "nav-bar-text-color": "#333",
          "search-background-color": "#eee"
        }
      }
    }
  },
  devServer: {
    proxy: {
      "/api": {
        changeOrigin: true,
        // target: "http://tianji.unspace.cn/cgi/api  http://ora.ngrok2.xiaomiqiu.cn"
        target: "http://zc.unspance.cn",
        pathRewrite: {
          "^/api": ""
        }
      }
    }
  },
  configureWebpack: { // webpack 配置
      output: {
        filename: `assets/js/[name].${process.env.VUE_APP_Version}.${Timestamp}.js`,
        chunkFilename: `assets/js/[name].${process.env.VUE_APP_Version}.${Timestamp}.js`
      },
    },
	chainWebpack: config =>{
	    config.plugin('html')
	      .tap(args => {
	        args[0].title = "未来科学城";
	        return args;
	      })
	  },
};
